package com.spring.quartz.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * <h3>partitionjob</h3>
 * <p>JobDemoService</p>
 *
 * @author : hduong
 * @version : 1.0
 * @date : 2019-12-17 18:14
 **/
public class JobDemoService implements Job {
    private static Log log = LogFactory.getLog(JobDemoService.class);

    public JobDemoService() {
    }

    @Autowired
    private DemoServiceProxy demoServiceProxy;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        List list = demoServiceProxy.query();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.err.println( simpleDateFormat.format(new Date()) + "   list=============================" + list);

    }
}
